from dashopt.celery import app
from django.core.mail import send_mail
from django.conf import settings
from utils.sms import YunTongXunAPI


@app.task
def async_send_active_email(email, verify_url):
    """
        功能函数:发送激活邮件
    """
    subject = "达达商城激活邮件"
    html_message = """
    尊敬的用户你好,请点击激活链接进行激活~~~
    <a href="%s" target="_blank">点击此处</a>
    """ % verify_url

    send_mail(subject, "", "309435365@qq.com", [email], html_message=html_message)


@app.task
def async_send_message(phone, code):
    """异步发送短信任务"""
    sms_api = YunTongXunAPI(**settings.SMS_CONFIG)
    sms_api.run(phone, code)





















